//
//  CZJCBaseTableViewController.swift
//  SinaWeibo
//
//  Created by mac on 15/10/6.
//  Copyright © 2015年 cz. All rights reserved.
//

import UIKit

class CZJCBaseTableViewController: UITableViewController,VisitorLoginViewDelegate {//遵守协议

    var loginView: VisitorLoginView?
   override func loadView() {

    loginView = NSBundle.mainBundle().loadNibNamed("VisitorLoginView", owner: nil, options: nil).last as? VisitorLoginView
    //设置代理
    loginView?.visitorDelegate = self
        view = loginView
    
    //设置导航栏上得按钮
    self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: "注册", style: UIBarButtonItemStyle.Plain, target: self, action: "visitorWillRegister")
    
    self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "登录", style: UIBarButtonItemStyle.Plain, target: self, action: "visitorWillLogin")
    
    }
    //实现代理方法
    func visitorWillRegister() {
        print(__FUNCTION__)
    }
    func visitorWillLogin() {
        print(__FUNCTION__)
        let sb = UIStoryboard(name: "OAuth", bundle: nil)
        let vc = sb.instantiateInitialViewController()!
        presentViewController(vc, animated: true, completion: nil)
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()

      
    }

   }
